package com.ztrue.test;

import com.ztrue.framework.core.command.CommandHandler;
import com.ztrue.framework.core.command.ICommandContext;

/**
 * @author zhangw
 * @date 2016/12/3 21:59
 * @version: 1.0
 */
public class CreateUserCommandHandler extends CommandHandler<CreateUserCommand> {
    public void handle(ICommandContext context, CreateUserCommand command) {
        //User tuser = context.get("1493193179423", User.class);
        //todo 聚合跟的查询是否需要判定为已操作？
        User user = new User(command.getAggregateRootId(), command.getName(), command.getSex());
        context.add(user);
    }
}
